package com.example.gatewayserver.filter;

import org.springframework.cloud.gateway.filter.GatewayFilterChain;
import org.springframework.cloud.gateway.filter.GlobalFilter;
import org.springframework.core.Ordered;
import org.springframework.http.HttpHeaders;
import org.springframework.stereotype.Component;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;

import java.util.List;

/**
 * @author Binlei.Zhang
 * @date: 2025/09/04 12:53
 */
@Component
public class TestFilter implements GlobalFilter, Ordered {
    @Override
    public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
        String testabc = (String)exchange.getAttributes().get("testabc");
        System.out.println("TestFilter,testabc:" + testabc);
     return chain.filter(exchange);
    }

    @Override
    public int getOrder() {
        return 0;
    }
}
